<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: UploadFile.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">UploadFile.h</div></div>
</div><!--header-->
<div class="contents">
<a href="UploadFile_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacedrogon.html">drogon</a></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span>{</div>
<div class="foldopen" id="foldopen00024" data-start="{" data-end="};">
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="classdrogon_1_1UploadFile.html">   24</a></span><span class="keyword">class </span><a class="code hl_class" href="classdrogon_1_1UploadFile.html">UploadFile</a></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>{</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>  <span class="keyword">public</span>:</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="}">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="classdrogon_1_1UploadFile.html#af1248ea1cef5d98040ea8fa7a7a0e570">   35</a></span>    <span class="keyword">explicit</span> <a class="code hl_function" href="classdrogon_1_1UploadFile.html#af1248ea1cef5d98040ea8fa7a7a0e570">UploadFile</a>(<span class="keyword">const</span> std::string &amp;filePath,</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>                        <span class="keyword">const</span> std::string &amp;<a class="code hl_function" href="classdrogon_1_1UploadFile.html#ada7278671acf1bb4b29b938d6c2a1bff">fileName</a> = <span class="stringliteral">&quot;&quot;</span>,</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>                        <span class="keyword">const</span> std::string &amp;<a class="code hl_function" href="classdrogon_1_1UploadFile.html#aa46087d2235cfc41d909e4e4c1930bbf">itemName</a> = <span class="stringliteral">&quot;file&quot;</span>,</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>                        <a class="code hl_enumeration" href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823">ContentType</a> <a class="code hl_function" href="classdrogon_1_1UploadFile.html#adfa92fac7d4bd95397f8f441cfc8efcd">contentType</a> = <a class="code hl_enumvalue" href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823a61e343a42203e1c58b16c9683e1f0876">CT_NONE</a>)</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>        : path_(filePath), itemName_(<a class="code hl_function" href="classdrogon_1_1UploadFile.html#aa46087d2235cfc41d909e4e4c1930bbf">itemName</a>), contentType_(<a class="code hl_function" href="classdrogon_1_1UploadFile.html#adfa92fac7d4bd95397f8f441cfc8efcd">contentType</a>)</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    {</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>        <span class="keywordflow">if</span> (!<a class="code hl_function" href="classdrogon_1_1UploadFile.html#ada7278671acf1bb4b29b938d6c2a1bff">fileName</a>.empty())</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>        {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>            fileName_ = <a class="code hl_function" href="classdrogon_1_1UploadFile.html#ada7278671acf1bb4b29b938d6c2a1bff">fileName</a>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        }</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>        {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>            <span class="keyword">auto</span> pos = filePath.rfind(<span class="charliteral">&#39;/&#39;</span>);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>            <span class="keywordflow">if</span> (pos != std::string::npos)</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>            {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>                fileName_ = filePath.substr(pos + 1);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>            }</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>            <span class="keywordflow">else</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>            {</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>                fileName_ = filePath;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>            }</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>        }</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    }</div>
</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="classdrogon_1_1UploadFile.html#a22a17d2717d77d9875da091304ddc8ee">   59</a></span>    <span class="keyword">const</span> std::string &amp;<a class="code hl_function" href="classdrogon_1_1UploadFile.html#a22a17d2717d77d9875da091304ddc8ee">path</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>        <span class="keywordflow">return</span> path_;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>    }</div>
</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="foldopen" id="foldopen00064" data-start="{" data-end="}">
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="classdrogon_1_1UploadFile.html#ada7278671acf1bb4b29b938d6c2a1bff">   64</a></span>    <span class="keyword">const</span> std::string &amp;<a class="code hl_function" href="classdrogon_1_1UploadFile.html#ada7278671acf1bb4b29b938d6c2a1bff">fileName</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>        <span class="keywordflow">return</span> fileName_;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>    }</div>
</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span> </div>
<div class="foldopen" id="foldopen00069" data-start="{" data-end="}">
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="classdrogon_1_1UploadFile.html#aa46087d2235cfc41d909e4e4c1930bbf">   69</a></span>    <span class="keyword">const</span> std::string &amp;<a class="code hl_function" href="classdrogon_1_1UploadFile.html#aa46087d2235cfc41d909e4e4c1930bbf">itemName</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>        <span class="keywordflow">return</span> itemName_;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    }</div>
</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="foldopen" id="foldopen00074" data-start="{" data-end="}">
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="classdrogon_1_1UploadFile.html#adfa92fac7d4bd95397f8f441cfc8efcd">   74</a></span>    <a class="code hl_enumeration" href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823">ContentType</a> <a class="code hl_function" href="classdrogon_1_1UploadFile.html#adfa92fac7d4bd95397f8f441cfc8efcd">contentType</a>()<span class="keyword"> const</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span><span class="keyword">    </span>{</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>        <span class="keywordflow">return</span> contentType_;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>    }</div>
</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>  <span class="keyword">private</span>:</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    std::string path_;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>    std::string fileName_;</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>    std::string itemName_;</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    <a class="code hl_enumeration" href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823">ContentType</a> contentType_;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>};</div>
</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>}  <span class="comment">// namespace drogon</span></div>
<div class="ttc" id="aclassdrogon_1_1UploadFile_html"><div class="ttname"><a href="classdrogon_1_1UploadFile.html">drogon::UploadFile</a></div><div class="ttdef"><b>Definition</b> UploadFile.h:25</div></div>
<div class="ttc" id="aclassdrogon_1_1UploadFile_html_a22a17d2717d77d9875da091304ddc8ee"><div class="ttname"><a href="classdrogon_1_1UploadFile.html#a22a17d2717d77d9875da091304ddc8ee">drogon::UploadFile::path</a></div><div class="ttdeci">const std::string &amp; path() const</div><div class="ttdef"><b>Definition</b> UploadFile.h:59</div></div>
<div class="ttc" id="aclassdrogon_1_1UploadFile_html_aa46087d2235cfc41d909e4e4c1930bbf"><div class="ttname"><a href="classdrogon_1_1UploadFile.html#aa46087d2235cfc41d909e4e4c1930bbf">drogon::UploadFile::itemName</a></div><div class="ttdeci">const std::string &amp; itemName() const</div><div class="ttdef"><b>Definition</b> UploadFile.h:69</div></div>
<div class="ttc" id="aclassdrogon_1_1UploadFile_html_ada7278671acf1bb4b29b938d6c2a1bff"><div class="ttname"><a href="classdrogon_1_1UploadFile.html#ada7278671acf1bb4b29b938d6c2a1bff">drogon::UploadFile::fileName</a></div><div class="ttdeci">const std::string &amp; fileName() const</div><div class="ttdef"><b>Definition</b> UploadFile.h:64</div></div>
<div class="ttc" id="aclassdrogon_1_1UploadFile_html_adfa92fac7d4bd95397f8f441cfc8efcd"><div class="ttname"><a href="classdrogon_1_1UploadFile.html#adfa92fac7d4bd95397f8f441cfc8efcd">drogon::UploadFile::contentType</a></div><div class="ttdeci">ContentType contentType() const</div><div class="ttdef"><b>Definition</b> UploadFile.h:74</div></div>
<div class="ttc" id="aclassdrogon_1_1UploadFile_html_af1248ea1cef5d98040ea8fa7a7a0e570"><div class="ttname"><a href="classdrogon_1_1UploadFile.html#af1248ea1cef5d98040ea8fa7a7a0e570">drogon::UploadFile::UploadFile</a></div><div class="ttdeci">UploadFile(const std::string &amp;filePath, const std::string &amp;fileName=&quot;&quot;, const std::string &amp;itemName=&quot;file&quot;, ContentType contentType=CT_NONE)</div><div class="ttdoc">Constructor</div><div class="ttdef"><b>Definition</b> UploadFile.h:35</div></div>
<div class="ttc" id="anamespacedrogon_html"><div class="ttname"><a href="namespacedrogon.html">drogon</a></div><div class="ttdoc">Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...</div><div class="ttdef"><b>Definition</b> Attribute.h:23</div></div>
<div class="ttc" id="anamespacedrogon_html_a2037a41934aeea1598d7468b4b8cb823"><div class="ttname"><a href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823">drogon::ContentType</a></div><div class="ttdeci">ContentType</div><div class="ttdef"><b>Definition</b> HttpTypes.h:100</div></div>
<div class="ttc" id="anamespacedrogon_html_a2037a41934aeea1598d7468b4b8cb823a61e343a42203e1c58b16c9683e1f0876"><div class="ttname"><a href="namespacedrogon.html#a2037a41934aeea1598d7468b4b8cb823a61e343a42203e1c58b16c9683e1f0876">drogon::CT_NONE</a></div><div class="ttdeci">@ CT_NONE</div><div class="ttdef"><b>Definition</b> HttpTypes.h:101</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
